clone-section-class enables you to define those sections and classes of the source instrument you want to clone to a target instrument. You can also define new target sections and describe how they differ from the original.
Section cloning takes place in given classes, a source instrument and a multitude of target instruments. The following clones bass zones and symbols to synth1 and synth2 so that bass section a becomes section b of synth1 and synth2, and the bass section b becomes the sections c and e of synth1 and synth2. The nil after each section statement indicates that no operations are performed on the sections currently beeing cloned.
Both the source classes and target instruments can be a quoted atom representing one entity or a quoted list of entities. So, the following notation is also valid.
(clone-section-class symbol bass synth
sect-a (sect-b sect-c) nil
sect-b (sect-d sect-e) nil
)
You can also clone all classes at once using the :all keyword. This clones the bass section a to synth1 and synth2 in section b.
(clone-section-class :all bass (synth1 synth2)
sect-a sect-b nil
)
If you want to clone bass section a to synth section b and change only the symbols, clone first :all classes with clone-section-class, and then redefine symbol class with def-class.
Note how the same-as refers to the same 'symbol 'synth1 'b, and returns the binding for this entity made before in the clone-section-class.
The next example shows you how to clone sections and instruments while making changes to them. The basic idea is the same, but there is one rule of thumb you have to keep in mind. If you clone sections using the do-section you can clone only one class at a time, like the symbol class in this example. You cannot clone multiple classes because the same do-section operation cannot always be applied to all classes. If you try to compile multiple classes with operation then no operations will be performed for any of the classes, and they are copied 'as is'.